# -*- coding: utf-8 -*-
from odoo import models, fields, api

class Stockmove(models.Model):
    _inherit = 'stock.move'

    # sale_order_id = fields.Many2one(comodel_name='sale.order', string='銷售訂單', readonly=True)
    # user_id = fields.Many2one(comodel_name='res.users', related='sale_order_id.user_id', string='業務員', readonly=True, store=True)
    #
    # def set_order_id(self):
    #     move_id = self.env['stock.move'].search([])
    #     for line in move_id:
    #         data = self.env['sale.order'].search([('name','=',line.group_id.name)])
    #         line.sale_order_id = data.id
    #         line.user_id = data.user_id.id